package com.example.studykotlin.kotlin_actual_combat.art.aidl.custom;

import android.os.IInterface;
import android.os.RemoteException;

import com.example.studykotlin.kotlin_actual_combat.art.aidl.Book;
import com.example.studykotlin.kotlin_actual_combat.art.aidl.IOnNewBookArrivedListener;

import java.util.List;

public interface IMyBookManager extends IInterface {
    //当前这个binder的唯一标识
    static final String DESCRIPTOR = "com.example.studykotlin.kotlin_actual_combat.art.aidl.IMyBookManager";

    //用于标识在t'ransact过程中客户端所请求的是哪个方法
    static final int TRANSACTION_getBookList = (android.os.IBinder.FIRST_CALL_TRANSACTION);
    static final int TRANSACTION_addBook = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
    static final int TRANSACTION_registerListener = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
    static final int TRANSACTION_unregisterListener = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);

    //仿照系统生成的代码格式书写
    public List<Book> getBookList() throws RemoteException;

    public void addBook(Book book) throws RemoteException;

    public void registerListener(IOnNewBookArrivedListener listener) throws RemoteException;

    public void unregisterListener(IOnNewBookArrivedListener listener) throws RemoteException;
}
